{include file="public_head"}
{include file="public_menu"}
  <div class="content_center">
    <div class="main_center">
      {include file="public_information_menu"}
      <div class="main_right right">
        <div class="main_right_title">修改登录密码</div>
        <div class="main_safety">

          <div class="center-pass">

            <div>
              <form action="" method="post" id="form">
              <div>
                <label>旧的密码</label>
                <input type="password" class="text" name="old_password" datatype="pwds" placeholder="请输入旧的登录密码，以验证身份"  nullmsg="请输入旧的登录密码" errormsg="6-18位数字字母">
              </div>
              <div>
                <label>设置新密码</label>
                <input type="password" class="text" name="new_password" datatype="pwds" placeholder="请设置新的登录密码" nullmsg="请输入新的登录密码" errormsg="6-18位数字字母">
              </div>
              <div>
                <label>再次输入确认</label>
                <input type="password" class="text" name="unpwd" datatype="pwds" placeholder="请再次输入新的登录密码" nullmsg="请再次输入新的登录密码" errormsg="6-18位数字字母">
              </div>
              <div>
                <input type="submit" value="完成" class="submit" id="sub">
              </div>
              </form>
            </div>

          </div>

        </div>
      </div>
    </div>
 <script>
   // 修改密码提交
   $(function () {
     $.Tipmsg.r = null;
     $.Tipmsg.p = null;
     $.Datatype.pwds = /^[a-zA-Z0-9]{6,18}$/;
     // 表单验证
     $("#form").Validform({
       tiptype: function (msg) {
         layer.msg(msg, {icon: 2});
       },
       btnSubmit: '#sub',
       tipSweep: true,
       // ajax 提交
       ajaxPost: true,
       callback: function (t) {
         if (t.code == 200) {
           layer.msg('修改成功', {icon: 1});
           // 跳转页面
           setTimeout(function(){
             layer.closeAll('loading');
             // 跳转页面
             location.href = "{:url('Login/index')}";
           }, 3000);
         } else {
           layer.msg(t.message, {icon: 2});
           setTimeout(function(){
             layer.closeAll('loading');
             // 跳转页面
             location.reload();
           }, 3000);
         }

       }
     });
   })
 </script>
{include file="public_foot"}